#include <stdio.h>

int main() {
    int scores[10];
    int max_score, min_score, sum = 0;

    printf("请输入10个学生的C成绩：\n");
    for (int i = 0; i < 10; i++) {
        scanf("%d", &scores[i]);
    }

    // 寻找最高分和最低分并计算总分
    max_score = scores[0];
    min_score = scores[0];
    for (int i = 0; i < 10; i++) {
        sum += scores[i];
        if (scores[i] > max_score) {
            max_score = scores[i];
        }
        if (scores[i] < min_score) {
            min_score = scores[i];
        }
    }

    // 输出成绩
    printf("10个学生的C成绩分别为：\n");
    for (int i = 0; i < 10; i++) {
        printf("%d\t", scores[i]);
    }
    printf("\n");

    // 输出最高分、最低分和平均分
    printf("最高成绩是%d,是第%d个学生\n", max_score, findStudentIndex(scores, max_score));
    printf("最低成绩是%d,是第%d个学生\n", min_score, findStudentIndex(scores, min_score));
    printf("10名学生的C成绩的平均分为:%.2f\n", (float)sum / 10);

    return 0;
}

int findStudentIndex(int scores[], int target) {
    for (int i = 0; i < 10; i++) {
        if (scores[i] == target) {
            return i + 1;
        }
    }
    return -1;
}
